#pragma
#include<stdio.h>

#define SIZE 4096
#define NONE_FLUSH (1<<1)
#define LINE_FLUSH (1<<2)
#define FULL_FLUSH (1<<3)

typedef struct _myFILE{
    char inbuffer[SIZE];
    char outbuffer[SIZE];
    int pos; // current buffer's position
    int cap; // the buffer's capacity
    int fileno; // the fileno (fd)
    int flush_mode; 
}myFILE;
myFILE* my_fopen(const char* pathname,const char* mode);
void my_fclose(myFILE*fp);
int my_fwrite(myFILE*fp, char* str,size_t size);
int my_fread(myFILE*fp, char* str,size_t size);
void my_fflush(myFILE*fp);